package day10.Exer;

public class Triangle extends Diagram {
    private double a;
    private double b;
    private double c;

    public Triangle(String name,double a, double b, double c) {
       super(name);
        this.a = a;
        this.b = b;
        this.c = c;
    }

    public double getA() {
        return a;
    }

    public void setA(double a) {
        this.a = a;
    }

    public double getB() {
        return b;
    }

    public void setB(double b) {
        this.b = b;
    }

    public double getC() {
        return c;
    }

    public void setC(double c) {
        this.c = c;
    }

    @Override
    public double getperimeter() {
        return a+b+c;
    }

    @Override
    public double getarea() {
        return 0.25*Math.sqrt((a+b+c)*(a+b-c)*(a+c-b)*(b+c-a));
    }
}
